<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="common/head :: head"></head>
<body>

<div th:replace="common/header :: header"></div>

<div class="layui-container fly-marginTop">
  <div class="fly-panel fly-panel-user" pad20>
    <div class="layui-tab layui-tab-brief" lay-filter="user">
      <ul class="layui-tab-title">
        <li><a th:href="@{/user/login}" href="login.html">登入</a></li>
        <li class="layui-this" th:text="${ error != null?'找回密码':'重置密码'}">找回密码<!--重置密码--></li>
      </ul>
      <div class="layui-form layui-tab-content" id="LAY_ucm" style="padding: 20px 0;">
        <div class="layui-tab-item layui-show">
          <!-- 重置密码 -->
          <th:block th:if="${type == 'repass' && error == null}" >
          <div class="fly-msg" >[[${session.nickName}]]，请重置您的密码</div>
          <div class="layui-form layui-form-pane"  style="margin-top: 30px;">
            <form method="post">
              <div class="layui-form-item">
                <label for="L_pass" class="layui-form-label">密码</label>
                <div class="layui-input-inline">
                  <input type="password" id="L_pass" name="pass" required lay-verify="required|password" autocomplete="off" class="layui-input">
                </div>
                <div class="layui-form-mid layui-word-aux">6到16个字符</div>
              </div>
              <div class="layui-form-item">
                <label for="L_repass" class="layui-form-label">确认密码</label>
                <div class="layui-input-inline">
                  <input type="password" id="L_repass" name="repass" required lay-verify="required|password" autocomplete="off" class="layui-input">
                </div>
              </div>
              <div class="layui-form-item">
                <label for="L_vercode" class="layui-form-label">验证码</label>
                <div class="layui-input-inline">
                  <input type="text" id="L_vercode" name="vercode" required lay-verify="required" placeholder="请输入验证码" autocomplete="off" class="layui-input">
                </div>
                <div class="layui-form-mid">
                  <img th:src="@{/user/images/captcha.png}" class="fly-imagecode" >
                </div>
              </div>
              <div class="layui-form-item">
                <button class="layui-btn" alert="1" lay-filter="*" lay-submit>提交</button>
              </div>
            </form>
          </div>
          </th:block>

          <div class="fly-error" th:if="${error!=null}" th:text="${error}">该重置密码链接已失效，请重新校验您的信息</div>

          <div th:if="${type == 'forget' || error != null}" class="layui-form layui-form-pane">
            <form method="post" th:action="@{/user/forget/}">
              <div class="layui-form-item">
                <label for="L_email" class="layui-form-label">邮箱</label>
                <div class="layui-input-inline">
                  <input type="text" id="L_email" name="email" required lay-verify="required|myemail" autocomplete="off" class="layui-input">
                </div>
              </div>
              <div class="layui-form-item">
                <label for="L_vercode" class="layui-form-label">验证码</label>
                <div class="layui-input-inline">
                  <input type="text" id="L_vercode" name="vercode" required lay-verify="required" placeholder="请输入验证码" autocomplete="off" class="layui-input">
                </div>
                <div class="layui-form-mid">
                  <img th:src="@{/user/images/captcha.png}" class="fly-imagecode" >
                </div>
              </div>
              <div class="layui-form-item">
                <button class="layui-btn" alert="1" flush-imagecode="true" lay-filter="*" lay-submit>提交</button>
              </div>
            </form>
          </div>
          
        </div>
      </div>
    </div>
  </div>

  
</div>

<div th:replace="common/footer :: footer"></div>
<script th:replace="common/common-js :: js"></script>
<script>
layui.config({
  base: '/res/mods/'
}).extend({
  fly: 'index'
}).use(['fly','user']);
</script>

</body>
</html>